package com.atstudy.headline.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 系统运营日统计表
 * @TableName system_operation_daily
 */
@TableName(value ="system_operation_daily")
@Data
public class SystemOperationDaily {
    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 统计日期
     */
    private Date statDate;

    /**
     * 日活跃用户数
     */
    private Integer dau;

    /**
     * 月活跃用户数(当月累计)
     */
    private Integer mau;

    /**
     * 新增用户数
     */
    private Integer newUsers;

    /**
     * 活跃用户数(有行为的用户)
     */
    private Integer activeUsers;

    /**
     * 发布内容数
     */
    private Integer contentPublished;

    /**
     * 评论数
     */
    private Integer commentsPosted;

    /**
     * 平均会话时长(秒)
     */
    private Integer avgSessionDuration;

    /**
     * 跳出率(%)
     */
    private BigDecimal bounceRate;

    /**
     * 创建时间
     */
    private Date createTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SystemOperationDaily other = (SystemOperationDaily) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStatDate() == null ? other.getStatDate() == null : this.getStatDate().equals(other.getStatDate()))
            && (this.getDau() == null ? other.getDau() == null : this.getDau().equals(other.getDau()))
            && (this.getMau() == null ? other.getMau() == null : this.getMau().equals(other.getMau()))
            && (this.getNewUsers() == null ? other.getNewUsers() == null : this.getNewUsers().equals(other.getNewUsers()))
            && (this.getActiveUsers() == null ? other.getActiveUsers() == null : this.getActiveUsers().equals(other.getActiveUsers()))
            && (this.getContentPublished() == null ? other.getContentPublished() == null : this.getContentPublished().equals(other.getContentPublished()))
            && (this.getCommentsPosted() == null ? other.getCommentsPosted() == null : this.getCommentsPosted().equals(other.getCommentsPosted()))
            && (this.getAvgSessionDuration() == null ? other.getAvgSessionDuration() == null : this.getAvgSessionDuration().equals(other.getAvgSessionDuration()))
            && (this.getBounceRate() == null ? other.getBounceRate() == null : this.getBounceRate().equals(other.getBounceRate()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStatDate() == null) ? 0 : getStatDate().hashCode());
        result = prime * result + ((getDau() == null) ? 0 : getDau().hashCode());
        result = prime * result + ((getMau() == null) ? 0 : getMau().hashCode());
        result = prime * result + ((getNewUsers() == null) ? 0 : getNewUsers().hashCode());
        result = prime * result + ((getActiveUsers() == null) ? 0 : getActiveUsers().hashCode());
        result = prime * result + ((getContentPublished() == null) ? 0 : getContentPublished().hashCode());
        result = prime * result + ((getCommentsPosted() == null) ? 0 : getCommentsPosted().hashCode());
        result = prime * result + ((getAvgSessionDuration() == null) ? 0 : getAvgSessionDuration().hashCode());
        result = prime * result + ((getBounceRate() == null) ? 0 : getBounceRate().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", statDate=").append(statDate);
        sb.append(", dau=").append(dau);
        sb.append(", mau=").append(mau);
        sb.append(", newUsers=").append(newUsers);
        sb.append(", activeUsers=").append(activeUsers);
        sb.append(", contentPublished=").append(contentPublished);
        sb.append(", commentsPosted=").append(commentsPosted);
        sb.append(", avgSessionDuration=").append(avgSessionDuration);
        sb.append(", bounceRate=").append(bounceRate);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}
